package com.bidbid.security.service.impl;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.Authentication;
import org.springframework.security.context.SecurityContextHolder;
import org.springframework.security.ui.webapp.AuthenticationProcessingFilter;

import com.bidbid.security.domain.User;





public class DragonAuthenticationProcessingFilter extends
		AuthenticationProcessingFilter {

	Logger logger=Logger.getLogger("LoginInfo");
	
	@Override
	protected void onSuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response,
            Authentication authResult) throws IOException {
		User user=(User)authResult.getPrincipal();
		logger.info(user.getLoginName()+"("+user.getTrueName()+") login successful");
    }
	
}
